<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>NXTCam Vision System<br/>
<small>
[<a class="el" href="group__mindsensors.html">Mindsensors</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structblob.html">blob</a></td></tr>
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mindsensors-nxtcam_8h.html">mindsensors-nxtcam.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>Mindsensors NXTCam driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga3104c35d33ecdfdcaa2af97f1691df8a">MAX_BLOBS</a>&#160;&#160;&#160;8</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga36fbe48f1799ef0af9efab553c0bd9c9">NXTCAM_I2C_ADDR</a>&#160;&#160;&#160;0x02</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gad16acce76c61ecff2aec7e38ba6537cf">NXTCAM_CMD_REG</a>&#160;&#160;&#160;0x41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga87f344485cd003c785b54959c883b924">NXTCAM_COUNT_REG</a>&#160;&#160;&#160;0x42</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gadd6a460c504511474edf8a6f4e9687a6">NXTCAM_DATA_REG</a>&#160;&#160;&#160;0x43</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaac63b3236275d61b690cb17ea7634072">SIDE_CENTER</a>(X1, X2)&#160;&#160;&#160;((X1 + X2) / 2)</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structblob.html">blob</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> [MAX_BLOBS]</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaa9503a35f45a1ffa5b298c65e95badf0">NXTCAMinit</a> (tSensors link, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga47cb3406f218eeb9e9711d0a7184e410">NXTCAMinitTL</a> (tSensors link, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga5259766d6514ee73a08421ac88e77b12">NXTCAMgetBlobs</a> (tSensors link, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, bool mergeBlobs, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaad3f1f7dadba3f8386b4756ce9f1888f">NXTCAMgetBlobs</a> (tSensors link, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, ubyte address=NXTCAM_I2C_ADDR)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga37e1ce7e64e571b7c3480404462d67e7">_camera_cmd</a> (tSensors link, byte cmd, ubyte address)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gadb70d2a4b3e24685060d2bcf95d9b473">_mergeBlobs</a> (int blob1, int blob2, int nblobs, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga444410109e39138d52242c0570b5d0f9">_merge</a> (int nblobs, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga1d6f5eddd1d996914310d608d031664e">_sortBlobs</a> (int nblobs, <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga177c2ae2e5fcc598179d2289b3a420df">NXTCAMgetAverageCenter</a> (<a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, int nblobs, int colourindex, int &amp;x, int &amp;y)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga6ca36236d45c9cdc7bbc56f266bdf6c6">NXTCAMgetCenter</a> (<a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;blobs, int index, int &amp;x, int &amp;y)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gaa1d603a296a06a71f002d0535d5e14fb">NXTCAM_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#gabb37063af562082aa6d0b0bf50278b6e">NXTCAM_I2CReply</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nxtcam.html#ga02fd1071ae1b5e8665557ab086c33112">still_merging</a> = false</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>NXTCam Vision System </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga3104c35d33ecdfdcaa2af97f1691df8a"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::MAX_BLOBS" ref="ga3104c35d33ecdfdcaa2af97f1691df8a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_BLOBS&#160;&#160;&#160;8</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Maximum number of blobs returned by the NXTCam </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00048">48</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad16acce76c61ecff2aec7e38ba6537cf"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAM_CMD_REG" ref="gad16acce76c61ecff2aec7e38ba6537cf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NXTCAM_CMD_REG&#160;&#160;&#160;0x41</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register used for issuing commands </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00050">50</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga87f344485cd003c785b54959c883b924"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAM_COUNT_REG" ref="ga87f344485cd003c785b54959c883b924" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NXTCAM_COUNT_REG&#160;&#160;&#160;0x42</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register used to hold number of blobs detected </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00051">51</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gadd6a460c504511474edf8a6f4e9687a6"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAM_DATA_REG" ref="gadd6a460c504511474edf8a6f4e9687a6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NXTCAM_DATA_REG&#160;&#160;&#160;0x43</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Register containing data pertaining to blobs </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00052">52</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga36fbe48f1799ef0af9efab553c0bd9c9"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAM_I2C_ADDR" ref="ga36fbe48f1799ef0af9efab553c0bd9c9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define NXTCAM_I2C_ADDR&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>I2C address used by the NXTCam </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00049">49</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaac63b3236275d61b690cb17ea7634072"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::SIDE_CENTER" ref="gaac63b3236275d61b690cb17ea7634072" args="(X1, X2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SIDE_CENTER</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">X1, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">X2&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((X1 + X2) / 2)</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the center of a side </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00054">54</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gaa3db0dd75c1de6e6a73579910a97f8e8"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::blob_array" ref="gaa3db0dd75c1de6e6a73579910a97f8e8" args="[MAX_BLOBS]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structblob.html">blob</a> <a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a>[MAX_BLOBS]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array of blob as a typedef, this is a work around for RobotC's inability to pass an array to a function </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-nxtcam-test1_8c-example.html#a0">mindsensors-nxtcam-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00067">67</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga37e1ce7e64e571b7c3480404462d67e7"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::_camera_cmd" ref="ga37e1ce7e64e571b7c3480404462d67e7" args="(tSensors link, byte cmd, ubyte address)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool _camera_cmd </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">byte&#160;</td>
          <td class="paramname"> <em>cmd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function sends a command to the camera over I2C.</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">cmd</td><td>the command to be sent </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0x02 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00098">98</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga444410109e39138d52242c0570b5d0f9"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::_merge" ref="ga444410109e39138d52242c0570b5d0f9" args="(int nblobs, blob_array &amp;blobs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int _merge </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>nblobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Go through the blobs and calls _mergeBlobs.</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">nblobs</td><td>the number of blobs </td></tr>
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of blobs detected </dd></dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00232">232</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gadb70d2a4b3e24685060d2bcf95d9b473"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::_mergeBlobs" ref="gadb70d2a4b3e24685060d2bcf95d9b473" args="(int blob1, int blob2, int nblobs, blob_array &amp;blobs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int _mergeBlobs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>blob1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>blob2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>nblobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if two blobs can be merged into one. blob1 will be replaced with the new merged blob and blob2 will be destroyed.</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">blob1</td><td>the index number of the first blob </td></tr>
    <tr><td class="paramname">blob2</td><td>the index number of the second blob </td></tr>
    <tr><td class="paramname">nblobs</td><td>the number of blobs </td></tr>
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of blobs detected </dd></dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00256">256</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga1d6f5eddd1d996914310d608d031664e"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::_sortBlobs" ref="ga1d6f5eddd1d996914310d608d031664e" args="(int nblobs, blob_array &amp;blobs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _sortBlobs </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>nblobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function sorts the blobs in the array using insertion sort.</p>
<p>Note: this is an internal function and should not be called directly. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">nblobs</td><td>the number of blobs </td></tr>
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00326">326</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga177c2ae2e5fcc598179d2289b3a420df"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAMgetAverageCenter" ref="ga177c2ae2e5fcc598179d2289b3a420df" args="(blob_array &amp;blobs, int nblobs, int colourindex, int &amp;x, int &amp;y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NXTCAMgetAverageCenter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>nblobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>colourindex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calculate the average center of all the blobs of a specific colour.</p>
<p>Note: this is an experimental function and may not function properly yet. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
    <tr><td class="paramname">nblobs</td><td>the number of blobs </td></tr>
    <tr><td class="paramname">colourindex</td><td>the colour of the blobs of which the average center is to be calculated </td></tr>
    <tr><td class="paramname">x</td><td>x-coordinate of the center </td></tr>
    <tr><td class="paramname">y</td><td>y-coordinate of the center </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00358">358</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaad3f1f7dadba3f8386b4756ce9f1888f"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAMgetBlobs" ref="gaad3f1f7dadba3f8386b4756ce9f1888f" args="(tSensors link, blob_array &amp;blobs, ubyte address=NXTCAM_I2C_ADDR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NXTCAMgetBlobs </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function fetches the blob data from the camera. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0x02 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of blobs detected, -1 if an error occurred </dd></dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00183">183</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga5259766d6514ee73a08421ac88e77b12"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAMgetBlobs" ref="ga5259766d6514ee73a08421ac88e77b12" args="(tSensors link, blob_array &amp;blobs, bool mergeBlobs, ubyte address=NXTCAM_I2C_ADDR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NXTCAMgetBlobs </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"> <em>mergeBlobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function fetches the blob data from the camera and merges the colliding ones. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
    <tr><td class="paramname">mergeBlobs</td><td>whether or not to merge the colliding blobs </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0x02 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of blobs detected, -1 if an error occurred </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-nxtcam-test1_8c-example.html#a3">mindsensors-nxtcam-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00169">169</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga6ca36236d45c9cdc7bbc56f266bdf6c6"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAMgetCenter" ref="ga6ca36236d45c9cdc7bbc56f266bdf6c6" args="(blob_array &amp;blobs, int index, int &amp;x, int &amp;y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NXTCAMgetCenter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__nxtcam.html#gaa3db0dd75c1de6e6a73579910a97f8e8">blob_array</a> &amp;&#160;</td>
          <td class="paramname"> <em>blobs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>y</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calculate the center of a specified blob.</p>
<p>Note: this is an experimental function and may not function properly yet. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">blobs</td><td>the array of blobs </td></tr>
    <tr><td class="paramname">index</td><td>the blob that you want to calculate the center of </td></tr>
    <tr><td class="paramname">x</td><td>x-coordinate of the center </td></tr>
    <tr><td class="paramname">y</td><td>y-coordinate of the center </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00384">384</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa9503a35f45a1ffa5b298c65e95badf0"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAMinit" ref="gaa9503a35f45a1ffa5b298c65e95badf0" args="(tSensors link, ubyte address=NXTCAM_I2C_ADDR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool NXTCAMinit </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function initialises camera ready to find blobs and sort them according to size. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0x02 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="mindsensors-nxtcam-test1_8c-example.html#a2">mindsensors-nxtcam-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00113">113</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga47cb3406f218eeb9e9711d0a7184e410"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAMinitTL" ref="ga47cb3406f218eeb9e9711d0a7184e410" args="(tSensors link, ubyte address=NXTCAM_I2C_ADDR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool NXTCAMinitTL </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ubyte&#160;</td>
          <td class="paramname"> <em>address</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function initialises camera ready to track lines. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the sensor port number </td></tr>
    <tr><td class="paramname">address</td><td>the I2C address to use, optional, defaults to 0x02 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00140">140</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="gabb37063af562082aa6d0b0bf50278b6e"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAM_I2CReply" ref="gabb37063af562082aa6d0b0bf50278b6e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__nxtcam.html#gabb37063af562082aa6d0b0bf50278b6e">NXTCAM_I2CReply</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C reply data </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00070">70</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa1d603a296a06a71f002d0535d5e14fb"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::NXTCAM_I2CRequest" ref="gaa1d603a296a06a71f002d0535d5e14fb" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__nxtcam.html#gaa1d603a296a06a71f002d0535d5e14fb">NXTCAM_I2CRequest</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00069">69</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga02fd1071ae1b5e8665557ab086c33112"></a><!-- doxytag: member="mindsensors&#45;nxtcam.h::still_merging" ref="ga02fd1071ae1b5e8665557ab086c33112" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="group__nxtcam.html#ga02fd1071ae1b5e8665557ab086c33112">still_merging</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>boolean to signal if there are still blobs that might qualify for merging </p>

<p>Definition at line <a class="el" href="mindsensors-nxtcam_8h_source.html#l00087">87</a> of file <a class="el" href="mindsensors-nxtcam_8h_source.html">mindsensors-nxtcam.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
